export const shareMixins = {
  data() {
    return {
      shareImage: 'https://oss-cc-wuhan-2.cecloudcs.com/meta-sports-image/images/93cd5548d654a3bf0ae396a950a3c4cb.png',
      shareTitle: 'MetaSports',
    };
  },
  shareTimeline(options) {
    let shareUrl = 'type=share';
    const shareObj = {
      title: this.shareTitle,
      query: shareUrl,
      imageUrl: this.shareImage,
    };
    return shareObj;
  },
  onShareAppMessage(options) {
    let shareUrl = '/pages/index/index?type=share';
    const shareObj = {
      title: this.shareTitle,
      path: shareUrl,
      imageUrl: this.shareImage,
    };
    return shareObj;
  },
  onLoad(options) {
    uni.showShareMenu({
      withShareTicket: true,
      menus: ['shareAppMessage', 'shareTimeline'],
    });
  },
};
